<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/15
 * Time: 10:18
 */
header("Content-type:text/html;charset=utf-8");
$a = "a" + "3px";
var_dump($a);

$v = 'c';
$a = "a" . $v . "b";

var_dump($a);

$url = 'http://www.baidu.com';
$siteName = 'baidu';
$s = '<a href="' . $url . '">' . $siteName . '</a>';
var_dump($s);

//.运算符，字符连接运算符，期待左右两边为字符，如果不是字符，会隐式转换成字符再运算
$a = true . 20;
var_dump($a);


$url = 'http://www.sohu.com';
$siteName = 'baidu';
$target = '_self';
$s = sprintf('<a href="%s" target="%s">%s</a>', $url, $target, $siteName);

var_dump($s);

$a = 7;
$b = 1;
$c = $a + $b;
$s = sprintf('树上%d个猴，以上%d个猴，总共有%d只猴', $a, $b, $c);

var_dump($s);

//二进制
$a = 8;
$s = sprintf('%032b', $a);

var_dump($s);
$s = sprintf('%032b', $a + 1);
var_dump($s);


//数字
echo sprintf("%s",  2+1);

/*
 * 00001
 * 00002
 */


//'aa';
//123;
//1233+123;
//$a = 'aa';
//(int)$a;

$a = 10;
$b  = 20;
$a .= $b;
//$a = $a + $b;
var_dump($a);